package org.oschina.api.favorite.favorite.plugin;

import org.oschina.api.favorite.favorite.dao.FavoriteDAO;
import org.oschina.api.user.user.model.User;
import org.oschina.plugin.AbstractPlugin;
import org.oschina.plugin.annotation.Plugin;
import org.springframework.beans.factory.annotation.Autowired;

@Plugin
public class UserLogoutFavoriteDataHandlePlugin extends AbstractPlugin {

	@Autowired
	private FavoriteDAO favoriteDAO;
	
	@Override
	public String getExplain()
	{
		return "用户退出收藏数据处理插件";
	}
	
	@Override
	public void logout(User user)
	{
		favoriteDAO.remvoeCache(user.getId());
	}

}